package com.letian.record.service.impl;

import java.util.List;
import com.letian.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.letian.record.mapper.RecordDistanceMapper;
import com.letian.record.domain.RecordDistance;
import com.letian.record.service.IRecordDistanceService;

/**
 * 记录距离Service业务层处理
 * 
 * @author bmz
 * @date 2023-01-15
 */
@Service
public class RecordDistanceServiceImpl implements IRecordDistanceService 
{
    @Autowired
    private RecordDistanceMapper recordDistanceMapper;

    /**
     * 查询记录距离
     * 
     * @param distanceId 记录距离主键
     * @return 记录距离
     */
    @Override
    public RecordDistance selectRecordDistanceByDistanceId(Long distanceId)
    {
        return recordDistanceMapper.selectRecordDistanceByDistanceId(distanceId);
    }

    /**
     * 查询记录距离列表
     * 
     * @param recordDistance 记录距离
     * @return 记录距离
     */
    @Override
    public List<RecordDistance> selectRecordDistanceList(RecordDistance recordDistance)
    {
        return recordDistanceMapper.selectRecordDistanceList(recordDistance);
    }

    /**
     * 查询记录距离列表
     *
     * @param recordDistance 记录距离
     * @return 记录距离
     */
    @Override
    public List<RecordDistance> selectRecordDistanceListToday(RecordDistance recordDistance)
    {
        return recordDistanceMapper.selectRecordDistanceListToday(recordDistance);
    }

    /**
     * 新增记录距离
     * 
     * @param recordDistance 记录距离
     * @return 结果
     */
    @Override
    public int insertRecordDistance(RecordDistance recordDistance)
    {
        recordDistance.setCreateTime(DateUtils.getNowDate());
        return recordDistanceMapper.insertRecordDistance(recordDistance);
    }

    /**
     * 修改记录距离
     * 
     * @param recordDistance 记录距离
     * @return 结果
     */
    @Override
    public int updateRecordDistance(RecordDistance recordDistance)
    {
        recordDistance.setUpdateTime(DateUtils.getNowDate());
        return recordDistanceMapper.updateRecordDistance(recordDistance);
    }

    /**
     * 批量删除记录距离
     * 
     * @param distanceIds 需要删除的记录距离主键
     * @return 结果
     */
    @Override
    public int deleteRecordDistanceByDistanceIds(Long[] distanceIds)
    {
        return recordDistanceMapper.deleteRecordDistanceByDistanceIds(distanceIds);
    }

    /**
     * 删除记录距离信息
     * 
     * @param distanceId 记录距离主键
     * @return 结果
     */
    @Override
    public int deleteRecordDistanceByDistanceId(Long distanceId)
    {
        return recordDistanceMapper.deleteRecordDistanceByDistanceId(distanceId);
    }
}
